import openpyxl
import os
path="g:\\zk2021\\"
path2="g:\\luqu.xlsx"
wb2=openpyxl.load_workbook(path2)
# print(wb2.get_sheet_names())
sheets = wb2.sheetnames
ws2=wb2[sheets[0]]
while 1:
    in_name=input("输入姓名：")
    for dir,folder,file in os.walk(path):
        # print(file)
        for f in file:
            # print(f)
            wb=openpyxl.load_workbook(path+f)
            ws=wb['sheet1']

            for r in range(2,ws.max_row+1):
                if in_name==ws.cell(row=r,column=2).value or in_name in ws.cell(row=r,column=2).value:
                    name=f[:-9]
                    print(name)

